package javao.cn;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;


@SpringBootApplication
public class Application {

	public static void main(String[] args) throws UnknownHostException {
		//        SpringApplication.run(WxHugApiApplication.class, args);
		/** System.setProperty("spring.devtools.restart.enabled", "false"); **/
		ConfigurableApplicationContext application = SpringApplication.run(Application.class, args);
		Environment env = application.getEnvironment();
		String ip = InetAddress.getLocalHost().getHostAddress();
		String port = env.getProperty("server.port");
		String path = env.getProperty("server.servlet.context-path");
		System.out.println("\n----------------------------------------------------------\n\t" +
				"Application Osps is running! Access URLs:\n\t" +
				"Local(端口): \t\thttp://localhost:" + port + path + "\n\t" +
				"External(IP端口): \thttp://" + ip + ":" + port + path + "\n\t" +
				"knife4j文档: \thttp://" + ip + ":" + port + path  +"swagger-ui/index.html"+"\n\t"+
				"----------------------------------------------------------");
	}

}